package com.example.demo.day.config.learn.design.factory.x2;

import com.example.demo.day.config.learn.design.factory.x1.Car;

public class FactoryTest {

    public static void main(String[] args) {
        Factory factory = new Factory();
        CarFactory suvFactory = factory.create(Factory.SUV);
        Car redSuvCar = suvFactory.create(CarFactory.RED);
        redSuvCar.run();

        CarFactory mpvFactory = factory.create(Factory.MPV);
        Car greenCar = mpvFactory.create(CarFactory.GREEN);
        greenCar.run();
    }
}
